﻿<BadHabit_WPFTools:ShapedWindow
    x:Name="window"
    x:Class="BadHabit.Factory.Windows.Error"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:BadHabit_WPFTools="clr-namespace:BadHabit.WPFTools;assembly=BadHabit.WPFTools"
    
    xmlns:props="clr-namespace:BadHabit.Factory.Properties"
    
    Title="Error"
    Width="400"                  
    SizeToContent="Height"
    SnapsToDevicePixels="True"
    WindowStyle="None"    
    ResizeMode="NoResize" 
    ShowInTaskbar="False"
    WindowStartupLocation="CenterScreen"
    Topmost="True"
    
    FocusManager.FocusedElement="{Binding ElementName=okButton}"
    
    >
    <Border Style="{StaticResource FactoryWindowBorder}">
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>
            <Border x:Name="PART_TitleBar" Grid.Row="0" Style="{StaticResource FactoryWindowTitleBorder}" Background="{StaticResource ErrorBackgroundBrush}">
                <TextBlock Style="{StaticResource ErrorTitleTextBlock}" Text="{Binding ElementName=window, Path=Title}" Foreground="{StaticResource ErrorForegroundBrush}"/>            
            </Border>
            <Border Grid.Row="1" Style="{StaticResource FactoryWindowContentBorder}">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="100"/>
                        <ColumnDefinition Width="*"/>
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="110"/>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="Auto"/>              
                    </Grid.RowDefinitions>
                    <Image x:Name="errorImage" Grid.Row="0" Grid.Column="0" Source="/Images/errorClient.png" Stretch="None" VerticalAlignment="Center" HorizontalAlignment="Center"/>
                    <TextBlock Grid.Row="0" Grid.Column="1" x:Name="messageTextBlock" Margin="0,5,5,0" Text="Error Message" TextWrapping="Wrap" VerticalAlignment="Top"/>                    
                    
                    <Border Grid.Row="2" Grid.ColumnSpan="2" Style="{StaticResource FactoryWindowErrorButtonBar}">
                        <Button
                            x:Name="okButton"
                            Style="{StaticResource OrangeButton}"
                            Width="100"
                            Click="Button_Click" Content="{x:Static props:Resources.Ok}"/>
                    </Border>
                
                
            </Grid>
            </Border>
        </Grid>
    </Border>                
</BadHabit_WPFTools:ShapedWindow>
